package com.itheima.test2;

/*
类名 对象名= new 类名();
对象名.成员
 */
public class Test {

    public static void main(String[] args) {
        Outer outer = new Outer();
        System.out.println(outer.getI());
        outer.setI(30);
        System.out.println(outer.getI());
        outer.useInner();


    }
}

class Outer {
    private int i = 10;

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    private void sing() {
        System.out.println("只因你太美");
    }

    public void useSing() {
        sing();
    }

    private class Inner {
        private int j = 10;

        public void dance() {
            System.out.println(i);
            sing();
            System.out.println("蹦迪蹦一晚");
        }
    }

    public void useInner() {
        Inner inner = new Inner();
        System.out.println(inner.j);
        inner.dance();
    }

}
